#version 410

uniform mat4 mv_matrix;
uniform mat4 proj_matrix;
uniform vec3 light_pos = vec3(100,100,100);

in vec3 VPos;
in vec3 VColor;
in vec3 VNormal;
in vec2 TexUV;


out VS_OUT{
    vec3 color;
    vec2 uv;
    vec3 N;
    vec3 L;
    vec3 V;
} vs_out;


void main()
{
   vs_out.color = VColor;
   vs_out.uv = TexUV;
   vec4 pos = vec4(VPos,1.0);

   vec4 P = mv_matrix * pos;
   vs_out.N = mat3(mv_matrix)*VNormal;
   vs_out.L = light_pos - P.xyz;
   vs_out.V = -P.xyz;

   gl_Position = proj_matrix * P;

}
